<script>
import config from './config'
import storage from './utils/storage'
import store from '@/store'
import { getToken } from '@/utils/auth'
import storageUtil from "@/utils/storageUtil"

export default {
  onLaunch() {
    this.initApp()
  },
  methods: {
    initApp() {
      this.initConfig()
      //#ifdef H5
      this.checkLogin()
      //#endif
    },
    initConfig() {
      this.globalData.config = config
    },
    checkLogin() {
      if (!getToken() && !storageUtil.getItem("token")) {
        this.$tab.reLaunch('/pages/login')
      }
    }
  }
}
</script>

<style lang="scss">
@import '@/static/scss/index.scss';
</style>
